/*
* @Author: 窦子滨<zibin_5257@163.com>
* @Date: 2019-11-29 16:26
 */
package main

//公共函数库

//进行重复过滤
func RemoveRepByLoop(u []string) []string {
	result := make([]string, 0, len(u)) // 存放结果
	tempMap := slice2Map(u)

	for k, _ := range tempMap {
		result = append(result, k)
	}

	return result
}

func slice2Map(list []string) map[string]struct{} {
	var temp = make(map[string]struct{})

	for _, v := range list {
		temp[v] = struct{}{}
	}
	return temp
}

func check(e error) {
	if e != nil {
		log.Error("发生错误：%s", e.Error())
	}
}
